<template>
	<view class="content">
		<view class="background">
			<view class="status_bar"></view>
			<view @click="navigateTo('/pages/my/set')" class="display-flex flex-end" style="padding: 30rpx;">
				<uv-icon name="setting-fill" size="25"></uv-icon>
			</view>
			<view class="padding-about-30">
				<view class="display-flex align-items">
					<image :src="userinfo.avatar" style="width: 120rpx;height: 120rpx;" class="border-radius" mode="">
					</image>
					<view class="file-1 margin-left-20">
						<view class="color-333 font-size-32 font-weight-bold">
							{{userinfo?.nickname_text}}
						</view>
						<view class=" margin-top-10 display-flex align-items">
							<uv-icon name="map-fill" color="#2671CE" size="14"></uv-icon>
							<view class="font-size-24 color-666">
								{{userinfo?.city_address}}
							</view>
						</view>
					</view>
				</view>
				<view class="display-flex space-between margin-top-30">
					<view @click="navigateTo('/pages/my/pointsRecord')" style="width: 33.333%;"
						class="display-flex flex-direction-column center align-items">
						<view class="font-size-32 font-weight-bold">
							{{userinfo?.score}}
						</view>
						<view class="font-size-24 color-666">
							积分
						</view>
					</view>
					<view style="width: 33.333%;" @click="navigateTo('/pages/my/Importcard/Importcard')"
						class="display-flex flex-direction-column center align-items">
						<view class="font-size-32 font-weight-bold">
							{{userinfo?.show_card_count?.card_all}}
						</view>
						<view class="font-size-24 color-666">
							卡库存
						</view>
					</view>
					<view style="width: 33.333%;" @click="navigateTo('/pages/my/cardStatistics')"
						class="display-flex flex-direction-column center align-items">
						<view class="font-size-32 font-weight-bold">
							{{userinfo?.show_card_count?.open_card_all}}
						</view>
						<view class="font-size-24 color-666">
							开卡总量
						</view>
					</view>
				</view>
				<view @click="navigateTo('/pages/my/subordinate?id=' + userinfo.id)"
					style="background: #2671CE;width: 690rpx;height: 166rpx; border-radius: 30rpx;"
					class="display-flex space-between align-items margin-top-30">
					<view style="width: 33.333%;"
						class="display-flex color-FFF flex-direction-column center align-items">
						<view class="font-size-32 font-weight-bold">
							{{userinfo?.show_card_count?.open_month_card_all}}
						</view>
						<view class="font-size-24 ">
							本月开卡
						</view>
					</view>
					<view style="width: 4rpx;height: 88rpx;background: #508CD7;"></view>
					<view style="width: 33.333%;"
						class="display-flex color-FFF flex-direction-column center align-items">
						<view class="font-size-32 font-weight-bold">
							{{userinfo?.show_card_count?.open_week_card_all}}
						</view>
						<view class="font-size-24">
							本周开卡
						</view>
					</view>
					<view style="width: 4rpx;height: 88rpx;background: #508CD7;"></view>
					<view style="width: 33.333%;"
						class="display-flex color-FFF flex-direction-column center align-items">
						<view class="font-size-32 font-weight-bold">
							{{userinfo?.show_card_count?.open_today_card_all}}
						</view>
						<view class="font-size-24">
							今日开卡
						</view>
					</view>
				</view>
				<view class="view margin-top-30">
					<view @click="navigateTo('/pages/show/Cardopeningdynamics/Cardopeningdynamics')"
						class="title display-flex space-between">
						<view class="display-flex align-items">
							<image src="/static/kk.png"
								style="width: 102.4rpx;height: 72rpx;margin-top: -30rpx;margin-left: 10rpx;"
								mode="aspectFill"></image>
							<view class="font-size-32 margin-left-20">
								开卡动态
							</view>
						</view>
						<view class="display-flex margin-right-20 align-items">
							<view style="color: #2671CE;" class="margin-right-10 font-size-26">
								更多
							</view>
							<uv-icon name="arrow-right" color="#2671CE" size="12"></uv-icon>
						</view>
					</view>
					<view class="">
						<view v-for="item,index in userinfo?.open_card_log" :key="index"
							@click="navigateTo('/pages/my/Cardopeningdynamicdetails/Cardopeningdynamicdetails?id=' + item.table_id)"
							class="">
							<view class="display-flex space-between" style="padding:20rpx 0;">
								<view class="font-size-26 file-1 webkit-line-clamp" style="-webkit-line-clamp: 1;">
									{{item.msg}}
								</view>
								<view style="color: #2671CE;" class="margin-right-10 font-size-26">
									更多
								</view>
							</view>
							<uv-gap height="1" bgColor="#F5F5F5"></uv-gap>
						</view>
						<!-- <view v-for="item,index in userinfo.open_card_log"
							
							:key="index" class="">
							<view class="display-flex space-between" style="padding:20rpx 0;">
								<view class="font-size-26 file-1 webkit-line-clamp" style="-webkit-line-clamp: 1;">
									{{item.msg}}
								</view>
								<view style="color: #2671CE;" class="margin-right-10 font-size-26">
									更多
								</view>
							</view>
							<uv-gap height="1" bgColor="#F5F5F5"></uv-gap>
						</view> -->
					</view>
				</view>
				<view class="view margin-top-20">
					<view @click="navigateTo('/pages/my/Subordinateteam/Subordinateteam')"
						class="title display-flex space-between">
						<view class="display-flex align-items">
							<image src="/static/xs.png"
								style="width: 102.4rpx;height: 72rpx;margin-top: -30rpx;margin-left: 10rpx;"
								mode="aspectFill"></image>
							<view class="font-size-32 margin-left-20">
								下属团队
							</view>
						</view>
						<view class="display-flex margin-right-20 align-items">
							<view style="color: #2671CE;" class="margin-right-10 font-size-26">
								更多
							</view>
							<uv-icon name="arrow-right" color="#2671CE" size="12"></uv-icon>
						</view>
					</view>
					<view class="">
						<view v-for="item,index in userinfo.son_list"
							class="tabs margin-top-20 display-flex align-items" style="padding: 15rpx 20rpx;">
							<image :src="item.avatar" style="width: 78rpx;height: 78rpx;" class="border-radius-12"
								mode="">
							</image>
							<view class="display-flex space-between file-1 margin-left-10"
								@click="navigateTo('/pages/my/subordinate?id=' + item.id + '&mobile=' + item.mobile)">
								<view style="width: 33.333%;"
									class="display-flex flex-direction-column center align-items">
									<view class="font-size-24 font-weight-bold">
										{{item.nickname_text}}
									</view>
									<view class="">

									</view>
									<!-- <view class="font-size-22 color-666">
										网点
									</view> -->
								</view>
								<view style="width: 33.333%;"
									class="display-flex flex-direction-column center align-items">
									<view class="font-size-24 font-weight-bold">
										{{item.show_card_count.team_card_all}}
									</view>
									<view class="font-size-22 color-666">
										总库存
									</view>
								</view>
								<view style="width: 33.333%;"
									class="display-flex flex-direction-column center align-items">
									<view class="font-size-24 font-weight-bold">
										{{item.show_card_count.card_all}}
									</view>
									<view class="font-size-22 color-666">
										当前库存
									</view>
								</view>
							</view>
						</view>
						<!-- <view class="">
							<view class="display-flex space-between" style="padding:20rpx 0;">
								<view class="font-size-26 file-1 webkit-line-clamp" style="-webkit-line-clamp: 1;">
									金水区营业厅于4月20日开卡成功金水区营业厅于4月20日开卡成功金水区营业厅于4月20日开卡成功
								</view>
								<view style="color: #2671CE;" class="margin-right-10 font-size-26">
									更多
								</view>
							</view>
							<uv-gap height="1" bgColor="#F5F5F5"></uv-gap>
						</view> -->
					</view>
				</view>
			</view>
			<div class="kong"></div>
			<div class="kong"></div>
			<div class="kong"></div>
			<div class="kong"></div>
		</view>
		<uv-modal ref="modal" title="提示" content='你还未进行问卷调查 请先进行问卷调查 ' @confirm="confirm"></uv-modal>
		<m-tabbar :current="4"></m-tabbar>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive
	} from 'vue';
	import {
		onLoad,
		onShow,
		onReady,
		onReachBottom
	} from '@dcloudio/uni-app';
	import {
		nativeUI,
		navigateTo,
		navigateBack
	} from '@/utils/index.js';
	import * as api from '@/request/app.js'; // 引入api 方法
	import local from '@/utils/localStorage.js'; //引入本地存储方法
	const userinfo = ref({})
	const modal = ref(null)
	onLoad(function(option) {

	});
	onShow(function() {
		getuserinfo()
	});
	async function getuserinfo() {
		const {
			code,
			data
		} = await api.getuserinfo()
		if (code == 1) {
			local.set('userinfo', data)
			userinfo.value = data
			
			if(data.answer_score_status == 0){
				modal.value.open();
			}
		}
	}
	function confirm(e){
		navigateTo('/pages/my/testpaper')
	}
	onReady(function() {});
	onReachBottom(function() {});
</script>

<style scoped lang="scss">
	::v-deep .uv-modal__content__text{
		text-align: center !important;
	}
	.tabs {
		background: #F8F8F7;
		border-radius: 15rpx;
	}

	.title {
		width: 642rpx;
		height: 72rpx;
		background: #DCEAFF;
		border-radius: 20rpx;
	}

	.view {
		padding: 20rpx;
		border-radius: 20rpx;
		background: #FFFFFF;
	}

	.background {
		width: 750rpx;
		height: 507rpx;
		background: linear-gradient(180deg, #AECEFF 0%, #F5F5F5 100%);
	}
</style>